﻿@model Domain.Model.Bonus

@{
    ViewBag.Title = "Settlement";
}
@section Script
{
    <link href="/Content/calendar/skin/WdatePicker.css" rel="stylesheet" />
    <script src="/Content/calendar/WdatePicker.js"></script>

    <link href="~/Content/validBox/validBox.css" rel="stylesheet" />
    <script src="~/Content/validBox/validBox.js"></script>
}


@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>
            <h4>结算管理</h4>
        </legend>

        <div class="editor-label">
            期数：
        </div>
        <div class="editor-field">
            @Html.TextBoxReadonlyFor(i => i.No)
        </div>

        <div class="editor-label">
            开始日期：
        </div>
        <div class="editor-field">
            @Html.TextBoxReadonlyFor(i => i.BeginTime)
        </div>

        <div class="editor-label">
            结算日期：
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.EndTime, Html.ValidFor(i => i.EndTime, new { @class = "Wdate", onFocus = "WdatePicker({isShowClear:false,readOnly:true})", id = "d15" }))
        </div>

        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(i => i.Settlementer)
        @Html.HiddenFor(i => i.SettlementType)

        <p>
            <input type="button" value="保存" class="btn btn-info" onclick="save()" />
        </p>
    </fieldset>
}

<script type="text/javascript">
    function save() {
        $('form').validBox(function (r) {
            if (r == false)
                return;

            $.post("/Bonus/Settlement/",
                $("form").serialize(),
                function (data) {
                    if (data.state) {
                        this.location = data.value;
                    }
                });
        });
    }

</script>
